﻿using AppDesigner.XamlDom;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;

namespace AppDesignerTest
{
    [TestClass]
    public class XamlTypeFinderTests
    {
        [TestMethod]
        public void FindWindow()
        {
            XamlDomInitor.Init();
            Assert.AreEqual(typeof(Window), XamlTypeFinder.GetClrType(XamlConstants.PresentationNamespace, "Window"));
        }

        [TestMethod]
        public void FindButton()
        {
            XamlDomInitor.Init();
            Assert.AreEqual(typeof(Button), XamlTypeFinder.GetClrType(XamlConstants.PresentationNamespace, "Button"));
        }

        [TestMethod]
        public void FindBindingMarkupExtension()
        {
            XamlDomInitor.Init();
            Assert.AreEqual(typeof(StaticResourceExtension), XamlTypeFinder.GetClrType(XamlConstants.PresentationNamespace, "StaticResourceExtension"));
        }

        [TestMethod]
        public void FindNullExtension()
        {
            XamlDomInitor.Init();
            Assert.AreEqual(typeof(NullExtension), XamlTypeFinder.GetClrType(XamlConstants.XamlNamespace, "NullExtension"));
        }

        [TestMethod]
        public void TestCustomClass()
        {
            //TODO 这个地方可在后面完成
        }
    }
}
